What is what part of speech is before?

The word "before" can function as a preposition, an adverb, or a conjunction.

As a preposition, "before" is used to indicate the position in space or time of an object or event in relation to another. For example, "The sun sets before dinner."

As an adverb, "before" is used to indicate that something happened earlier in time or in a sequence of events. For example, "We had met before."

As a conjunction, "before" is used to introduce a clause that expresses the reason for or the time at which something happened. For example, "I'll call you before I leave."